load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "colserde",
    srcs = [
        "arrowbatchconverter.go",
        "file.go",
        "record_batch.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/col/colserde",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/col/colserde/arrowserde",
        "//pkg/col/typeconv",
        "//pkg/sql/memsize",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/duration",
        "//pkg/util/mon",
        "@com_github_apache_arrow_go_arrow//array",
        "@com_github_apache_arrow_go_arrow//memory",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_edsrzf_mmap_go//:mmap-go",
        "@com_github_google_flatbuffers//go",
    ],
)

go_test(
    name = "colserde_test",
    size = "small",
    srcs = [
        "arrowbatchconverter_test.go",
        "conversion_test.go",
        "file_test.go",
        "main_test.go",
        "record_batch_test.go",
    ],
    deps = [
        ":colserde",
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/col/coldatatestutils",
        "//pkg/col/typeconv",
        "//pkg/settings/cluster",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/memsize",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/types",
        "//pkg/testutils",
        "//pkg/util/json",
        "//pkg/util/leaktest",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "//pkg/util/timeutil",
        "@com_github_apache_arrow_go_arrow//:arrow",
        "@com_github_apache_arrow_go_arrow//array",
        "@com_github_apache_arrow_go_arrow//memory",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
